<div class="center">
	<div class="home">
    	<div class="home_left">
        	<?php echo $this->partial('member/menu.phtml',array('uCount' => $this->uCount,'menuId'=>$this->menuId,'user'=>$this->user)); ?>
        </div>
    	<div class="home_right">
            <div class="waybill">
                <div class="waybillTop">
                  <h1>我的国际运单</h1>
                  <p>去我的仓库：<a href="/member/mystore/" target="_blank">发送国际运单</a></p>
                </div>
                <div class="waybillTable">
                    <table>                                               
                        <tr>
                            <th class="w1">创建时间</th>
                            <th class="w2">流水号</th>
                            <th class="w3">运单信息</th>
                            <th class="w4">重量</th>
                            <th class="w5">运单状态</th>
                            <th class="w6">操作</th>
                        </tr>
                    </table>
                    <div class="wuyd"<?php if(!empty($this->waybilllist))  echo "style='display: none'"; ?>   >
                    	<h2>您还没有发送过国际运单！</h2>
                        <p>猜您会：<a href="/member/mystore">去我的仓库发送运单</a><i>|</i><a href="/member/instore/">我要预报包裹</a><i>|</i><a href="/purchase/agent">我要代购</a></p>
                    </div>
                    <table>
                        <?php foreach ($this->waybilllist as  $item){ ?> 
                        <tr>
                            <td class="w1"><p><?php echo date('Y-m-d',strtotime($item->dateCreated));?><span><?php echo date('h:i:s',strtotime($item->dateCreated));?></span></p></td>
                            <td class="w2"><?php echo $item->billNo;?></td>
                            <td class="w3">
                                <div class="WBinfo">
                                    <h2><?php echo $item->ExpressBy->Name ?>/收件人:<?php echo $item->Consignee;?></h2>
                                    <p>物流编号：<?php  echo ($item->logistics!="")?$item->logistics:"[暂无]";?></p>
                                    <a href="/member/waybillinfo/?id=<?= $item->id?>">运单详情&gt;&gt;</a>
                                </div>
                            </td>
                            <td class="w4"><?php  echo $item->weight;?>&nbsp;g</td>
                            <td class="w5">
                                <?php 
                                switch ($item->status)
                                {
                                    case 0:
                                        echo "<div class='WBZT'><a class='waybillfk' href='/pay/paying/type/3/id/".$item->id."'>待付款</a></div>";break;//等待付款
                                    case 1:
                                        echo "<div class='WBZT'><span>已付款，等待受理</span></div>";break;//正在准备
                                    case 2:
                                        echo "<div class='WBZT'><a class='waybillQR' href='/member/waybill/?oper=sign&id=".($item->id)."'>确认收货</a></div><div class='Track'><a class='Tracklink' href='/member/waybillinfo/?id=".$item->id."'>物流跟踪</a></div>";break;//已经发货
                                    case 100:
                                        echo "<div class='WBZT'><span class='waybillOK'>已完成收货</span></div>";
                                        echo "<div class='Track'><a class='Tracklink' href='/member/waybillinfo/?id=".$item->id."'>物流跟踪</a></div>";
                                        break;//已经完成
                                    case -1:
                                        echo "<div class='WBZT'><span class='waybillAbnormal'>已撤销</span></div>";break;//已撤销
                                    case -2:
                                        echo "<div class='WBZT'><span class='waybillAbnormal'>海关退货</span></div><div class='Track'><a class='Tracklink' href='/member/waybillinfo/?id=".$item->id."'>物流跟踪</a></div>";break;//海关退货
                                    default: 
                                        echo "<div class='WBZT'><span>".$item->statusname."</span></div>";
                                }
                                ?>
                            </td>
                            <td class="w6">
                                <?php if($item->status<=1 && $item->status>=0) echo "<div class='waycx'><a href='/member/waybill/?oper=cancel&id=".($item->id)."'>撤销运单</a></div>";?>
                                
                            </td>
                        </tr>         
                        <?php }?>
                    </table>
                </div>                
                <div class="toolbar" <?php if(empty($this->waybilllist))  echo "style='display: none'"; ?>>
                    <?php echo $this->partial('paging.phtml',array("pages"=>$this->waybills)); ?>
               </div>
            </div>
            
        </div>
    </div>
</div>